package com.woniuxy03;

/**
 * @author 作者
 * @create 2025-06-05 15:28
 */
public class Test01 {
    public static void main(String[] args) {
        String number = "12345";
        System.out.println(validateQq(number));

        String regexQq = "[1-9]\\d{4,14}";
        System.out.println(number.matches(regexQq));
        String regexEmail = "\\w+@\\w+\\.\\w+";
        System.out.println("abcd@163.com".matches(regexEmail));
        System.out.println("abcd163.com".matches(regexEmail));
        System.out.println("abcd163.co@m".matches(regexEmail));


    }

    public static boolean validateQq(String qq){
        if(!(qq.length()>=5 && qq.length()<=15)){
            return false;
        }
        if(qq.charAt(0)=='0'){
            return false;
        }
        char[] chars = qq.toCharArray();
        for(char c: chars){
            if(!Character.isDigit(c)){
                return false;
            }
        }
        return true;
    }
}
